Skip to content

[CNSL-1935] Add automated release PR workflow#95

Open
linhcrl wants to merge 1 commit intomainfrom
version-bump-workflow
Open

[CNSL-1935] Add automated release PR workflow#95
linhcrl wants to merge 1 commit intomainfrom
version-bump-workflow

Conversation

@linhcrl
Copy link
Copy Markdown
Contributor

@linhcrl linhcrl commented Mar 29, 2026

Added GitHub Actions workflow that automatically creates release PRs when pending-deploy-* branches are merged to main. The workflow uses the reusable workflow from cockroachdb/actions and updates all version references across the SDK including CHANGELOG.md, go.mod, config files, and documentation.

@linhcrl linhcrl changed the title Add version bump workflow [CNSL-1935] Add version bump workflow Mar 29, 2026
@linhcrl linhcrl force-pushed the version-bump-workflow branch from 242ab7f to 8ee0006 Compare March 29, 2026 07:50
@linhcrl
Copy link
Copy Markdown
Contributor Author

linhcrl commented Mar 29, 2026

Tested this locally and it worked as expected

@linhcrl linhcrl changed the title [CNSL-1935] Add version bump workflow DO NOT MERGE - [CNSL-1935] Add version bump workflow Mar 29, 2026
Comment thread .github/workflows/finalize-release.yml Outdated
Comment thread .github/workflows/finalize-release.yml Outdated
Comment thread .github/workflows/finalize-release.yml Outdated
Comment thread .github/workflows/finalize-release.yml Outdated
Comment thread internal/update-version.sh Outdated
Comment thread internal/update-version.sh Outdated
@linhcrl linhcrl marked this pull request as draft March 31, 2026 08:10
@linhcrl linhcrl changed the title DO NOT MERGE - [CNSL-1935] Add version bump workflow [CNSL-1935] Add version bump workflow Mar 31, 2026
@linhcrl linhcrl force-pushed the version-bump-workflow branch from 8ee0006 to f99ec07 Compare March 31, 2026 22:43
@github-actions
Copy link
Copy Markdown

No breaking changes detected.

@linhcrl linhcrl force-pushed the version-bump-workflow branch 8 times, most recently from c389a70 to b1e2713 Compare April 5, 2026 07:11
@linhcrl linhcrl changed the title [CNSL-1935] Add version bump workflow [CNSL-1935] Add automated release PR workflow Apr 5, 2026
@linhcrl linhcrl changed the title [CNSL-1935] Add automated release PR workflow DO NOT MERGE - [CNSL-1935] Add automated release PR workflow Apr 5, 2026
@linhcrl linhcrl marked this pull request as ready for review April 7, 2026 15:29
@linhcrl linhcrl force-pushed the version-bump-workflow branch 3 times, most recently from a96edc4 to fc74aa3 Compare April 13, 2026 15:37
@linhcrl linhcrl force-pushed the version-bump-workflow branch from fc74aa3 to de23fd1 Compare April 29, 2026 01:25
@linhcrl linhcrl changed the title DO NOT MERGE - [CNSL-1935] Add automated release PR workflow Add automated release PR workflow Apr 29, 2026
@linhcrl linhcrl changed the title Add automated release PR workflow [CNSL-1935] Add automated release PR workflow Apr 29, 2026
@linhcrl linhcrl requested a review from fantapop April 29, 2026 03:27
@linhcrl linhcrl force-pushed the version-bump-workflow branch from de23fd1 to 67ffaf4 Compare April 29, 2026 03:40
@fantapop
Copy link
Copy Markdown
Contributor

fantapop commented May 1, 2026

thanks for including the sample images. I noticed that the Changelog entries are extremely long. I think we'll want to experiment with the prompt we're using to build those.

Comment thread internal/update_version.sh Outdated
Comment on lines +11 to +12
echo "Error: VERSION environment variable must be set"
echo "This script is intended to be called by the create-release-pr workflow"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we print to stderr?

Comment thread internal/update-version.sh Outdated
@linhcrl
Copy link
Copy Markdown
Contributor Author

linhcrl commented May 1, 2026

thanks for including the sample images. I noticed that the Changelog entries are extremely long. I think we'll want to experiment with the prompt we're using to build those.

Please note this workflow does not generate any new changelog entries. This workflow simply takes the changelog entries from the unreleased section and puts them in the commit message and PR description for visibility (to recap what is going to be released). That is what you're seeing in the images I included.

The long changelog entry you're referring to is a changelog entry for another workflow I added earlier. It's not LLM generated.

The only thing the workflow in this PR is responsible for is updating the SDK version in the CHANGELOG and all other files that need the version number updated in preparation for the release.

@linhcrl linhcrl requested a review from fantapop May 1, 2026 17:17
@linhcrl linhcrl force-pushed the version-bump-workflow branch 5 times, most recently from 52e4efe to 23eaa26 Compare May 1, 2026 17:50
@fantapop
Copy link
Copy Markdown
Contributor

fantapop commented May 1, 2026

thanks for including the sample images. I noticed that the Changelog entries are extremely long. I think we'll want to experiment with the prompt we're using to build those.

Please note this workflow does not generate any new changelog entries. This workflow simply takes the changelog entries from the unreleased section and puts them in the commit message and PR description for visibility (to recap what is going to be released). That is what you're seeing in the images I included.

The long changelog entry you're referring to is a changelog entry for another workflow I added earlier. It's not LLM generated.

The only thing the workflow in this PR is responsible for is updating the SDK version in the CHANGELOG and all other files that need the version number updated in preparation for the release.

yeah makes sense. I didn't think it was coming from this PR. It just looked long and agent generated. You hand crafted it though?

Comment thread scripts/build/update_version.sh Outdated
Comment on lines +39 to +41
# Update docs/README.md
log_info "Updating docs/README.md..."
sed "s/^- Package version:.*/- Package version: $VERSION/" docs/README.md > docs/README.md.tmp && mv docs/README.md.tmp docs/README.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than duplicating the logic of copying the docs read me. I think we should create a new Makefile target like make docs and then call it from both the existing makefile target that uses it and here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I understand now (I think)! I added a makefile target but please note I called it sync-readme. docs felt a bit too broad as there are many other docs files that don't get touched as part of this. Additionally, make docs sounds like we are copying README into docs/README, but it's the other way around. Let me know what you think!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see what's going on now. In the normal workflow, we update the internal/spec/config.yaml file and then run the client generation step (make generate-openapi-client). That step creates the client and docs which includes a README. We then shift some of the directories around including copying the README from the docs/README location to README. Should we actually just run the make generate-openapi-client change? After understanding this better, i see that pulling the moving of the README to a separate makefile target seems silly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to run make generate-openapi-client. With this change, we no longer need to update README, docs/README, and pkg/client/configuration.go manually. Thanks for the suggestion

@linhcrl
Copy link
Copy Markdown
Contributor Author

linhcrl commented May 1, 2026

yeah makes sense. I didn't think it was coming from this PR. It just looked long and agent generated. You hand crafted it though?

I did use claude to write it. It's the changelog entry for this PR. I'was just trying to say it's not autogenerated by a workflow based on any prompt. I can update the relevant PR to make the entry shorter but it's a one off

@linhcrl linhcrl force-pushed the version-bump-workflow branch 3 times, most recently from cf22100 to 26a06db Compare May 1, 2026 20:48
@linhcrl linhcrl requested a review from fantapop May 1, 2026 20:53
@linhcrl linhcrl force-pushed the version-bump-workflow branch from 26a06db to 4b5eccc Compare May 1, 2026 21:00
@linhcrl
Copy link
Copy Markdown
Contributor Author

linhcrl commented May 1, 2026

@fantapop I've updated the reusable action to remove changelog entries from the commit message body.

Why: Commit message lines should be at most 72 characters, but changelog entries don't follow this rule. It would be unnecessarily complex to convert the changelog entries to wrap at 72 characters for the commit message. Since the individual commits already describe the changes and the changelog entries are visible in the PR description, the simpler approach is to use a hardcoded message format.

Here's the PR: cockroachdb/actions#27

@linhcrl linhcrl force-pushed the version-bump-workflow branch 4 times, most recently from f49c201 to 5ec108f Compare May 1, 2026 23:48
@fantapop
Copy link
Copy Markdown
Contributor

fantapop commented May 2, 2026

yeah makes sense. I didn't think it was coming from this PR. It just looked long and agent generated. You hand crafted it though?

I did use claude to write it. It's the changelog entry for this PR. I'was just trying to say it's not autogenerated by a workflow based on any prompt. I can update the relevant PR to make the entry shorter but it's a one off

ah I see. makes sense. we are planning to generate the changelog entry from claude though right? We should consider asking it to keep it brief.

Add GitHub Actions workflow that automatically creates release PRs when
pending-deploy-* branches are merged to main. The workflow updates
go.mod for major version changes, updates config.yaml with the new
version, and regenerates the OpenAPI client to automatically update all
generated files (README.md, docs/README.md,
pkg/client/configuration.go).

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@linhcrl linhcrl force-pushed the version-bump-workflow branch from 5ec108f to 03ec431 Compare May 4, 2026 22:33
Copy link
Copy Markdown
Contributor

@fantapop fantapop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good to me. It seems like we could get away with logging to stdout for info lines and stderr for warn and error lines.

Comment thread scripts/lib/logging.sh
Comment on lines +4 to +8
# Output an informational message to stderr
log_info() {
local message="$1"
echo "$message" >&2
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's surprising to me that all these need to go to stderr. Is it because some script that's using it, needs stdout for communicating between processes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants